
import java.sql.*;

public class connectMysql {

    public static void main(String[] args) {

        try {
            // 调用方法获取连接
            Connection conn = DBHelper.getConn();

            // 1.数据查询
            String sql = "select * from user";
            DBHelper.select(sql);

            // 2. 数据修改
            DBHelper.update(1,"zyx");
            DBHelper.select(sql);

            // 3. 数据的增加
            DBHelper.insert("aa","男","啊啊@162.com","1882-11-24");
            DBHelper.select(sql);

            // 4. 数据删除
            DBHelper.drop("aa");
            DBHelper.select(sql);

        } finally {
            // 调用关闭方法释放资源
            DBHelper.release();
        }
    }

}
